package com.sky.employee.mapper;


import com.sky.annotation.AutoFill;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import com.github.pagehelper.Page;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 员工管理 mapper
 */
@Mapper
public interface EmployeeMapper {

    /**
     * 登录查询
     */
    Employee selectEmpByUsername(@Param("username")String username);


    /**
     * 新增员工
     */
    @AutoFill(value = OperationType.INSERT)
    Integer insertEmployee(Employee employee);


    /**
     * 员工分页条件查询列表
     */
    Page<Employee> page(EmployeePageQueryDTO employeePageQueryDTO);


    /**
     * 通用方法 根据id修改
     */
    @AutoFill(value = OperationType.UPDATE)
    Integer updateById(Employee employee);


    /**
     * 根据id查询
     */
    Employee selectById(Long id);
}
